package cn.ssj.controller;

import cn.ssj.entity.About;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

@RestController
@EnableAutoConfiguration
public class AboutController extends BaseController<About,Integer> {

    @RequestMapping("/back/addAbout")
    public String add(About entity) {
        return super.add(entity);
    }

    @RequestMapping("/back/updateAbout")
    public String update(About entity) {
        return super.update(entity);
    }

    @RequestMapping("/back/deleteAbout")
    public String delete(@RequestParam("ids[]")Integer[] integers) {
        return super.delete(integers);
    }

    @RequestMapping("/back/queryAllAboutByPage")
    public String queryAllByPage(Integer pageNumber) {
        return super.queryAllByPage(pageNumber);
    }

    @RequestMapping("/back/aboutUpload")
    public String upload(MultipartFile file, HttpServletRequest request) {
        super.setLocationPath(getLocationPath()+ "about");
        super.setHandlerPath(getHandlerPath()+"about");
        return super.upload(file, request);
    }
}
